home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CDsupport / IDer / Routines / ProcessSuffix.s < prev    next >
Text File  |  1997-02-18  |  964b  |  31 lines

  1. ProcessSuffix:    Move.L    _Suffix(PC),A0        ;was the SUFFIX entry included for this class
  2.     Cmp.L    #0,A0
  3.     Beq.S    .NoSuffix
  4.  
  5.     Lea    WorkData,A1
  6.     Move.W    #'#?',(A1)+        ;add the wildcard to allow for anything before the suffix
  7.     Bsr    StripQuotes        ;copy the string, and remove any "'s while go.
  8.  
  9.     Move.L    #WorkData,D1
  10.     Move.L    #ParseData,D2
  11.     Move.L    #255,D3
  12.     CALL    ParsePatternNoCase,DOS    ;we need to "tokinize" the wildcards
  13.     Cmp.L    #-1,D0        ;-1 is something went wrong with the string
  14.     Beq.S    .BadSuffix
  15.  
  16.     Move.L    #ParseData,D1
  17.     Move.L    _FilePart(PC),D2
  18.     CALL    MatchPatternNoCase    ;try and match the suffix with the filename (taking into account the wildcard)
  19.     Tst.L    D0
  20.     Beq.S    .BadSuffix
  21.  
  22.     Addq.B    #1,_Successful        ;mark that the check was correct
  23.  
  24.     Cmp.B    #MODE_ONE,_Mode        ;are we running in OR mode
  25.     Beq    LaunchAction        ;if so, then run the ACTION command now
  26.     Bra.S    .NoSuffix
  27.  
  28. .BadSuffix    Cmp.B    #MODE_ALL,_Mode        ;are we running in OR mode
  29.     Beq    CheckLoop        ;if not, then abort the search
  30. .NoSuffix
  31.